// JavaScript Document
(function($){
    var h = {
        tip:function (content, icon = 'success', options){
            return top.$.jBox.tip(content, icon, options);
        },
        closeTip:function(){
            return $.jBox.closeTip();
        },
        messager:function(content, title, timeout, options){
            return $.jBox.messager(content, title, timeout, options);
        },
        closeMessager:function(content, title, timeout, options){
            return $.jBox.closeMessager();
        }
    };
    window['h'] = h;	  
})(jQuery);







//--------------------------------------------------------------------------------
(function($){
    var m = {
        d:{}, //数据
        openIframe:function (title='',url='',opts = null ){
            //http://layer.layui.com/
            var defaults = {
                type: 2
                ,title: title
                ,content: url
                ,maxmin:true
                ,resize:true 
                ,area: ['500px', '300px']

                


            }
            var opts = $.extend( {} , defaults , opts );

            var index = layer.open(opts);
            return index;
        },
        openIframeMax:function(title='',url='',opts = null ){
            var index = this.openIframe( title , url , opts );
            layer.full(index);
            return index;
        },
        openIframeFull:function(title='',url='',opts = null ){
           return  this.openIframeMax( title, url, opts);
        },
        colseIframeSelf:function(reload = false){
            if(reload){
                parent.location.reload();
            }else{
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            };
        },
        colseIframe:function(index){
            layer.close(index);
        }






    };
    window['m'] = m;      
})(jQuery);
//--------------------------------------------------------------------------------


    












//当文件加载完成 之后
$(function(){

    
    //单选按钮样式
    $('input:radio.iCheckXXX').iCheck({
        checkboxClass: 'icheckbox-blue',
        radioClass: 'iradio-blue',
        increaseArea: '20%'
    });
	//单选按钮样式
    $('input:checkbox.iCheckXXX').iCheck({
        checkboxClass: 'icheckbox-blue',
        radioClass: 'iradio-blue',
        increaseArea: '20%'
    });
    
    //最多输入100个字符
    $('[inputLength]').each(function(){
                                     
        var $this = $(this);
        
        $this.Huitextarealength({
            minlength:0,
            maxlength:100,
            exceed:false
        });
    });
		//日期插件
	$("[datetimepicker]").datetimepicker({
    	format: 'yyyy-mm-dd',
		minView: "month",
		todayBtn:  1,
		autoclose: 1,
		endDate : new Date()
	}).on('hide',function(e) {
		//此处可以触发日期校验。
	});
	
	/*+1 -1效果*/
	$("#spinner-demo").Huispinner({
		value:1,
		minValue:1,
		maxValue:99,
		dis:1 ,
		name:'name'
	});


    
    
});

